package com.gitee.webdav.xml;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.gitee.webdav.kernel.Remark;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author hongda.li@hand-china.com
 */
@Data
@Accessors(chain = true)
@Remark("错误消息")
@JacksonXmlRootElement(localName = "error", namespace = "DAV:")
public class Error {

    @Remark("具体错误消息内容")
    @JacksonXmlProperty(localName = "message", namespace = "DAV:")
    private String message;

    public static Error of(String message) {
        Error error = new Error();
        error.message = message;
        return error;
    }
}